<?php
/**
 * Created by PhpStorm.
 * User: jocky
 * Date: 07/10/2017
 * Time: 15:08
 */
?>
<div class="row">
    <div class="col-md-12">
        <form class="form-horizontal" id="form_moneyRecharge">
            <div class="panel panel-default">
                <div class="panel-body" style="font-size: 20px;">
                    入金
                </div>
            </div>
        </form>
    </div>
</div>

<div class="row">
    <div class="col-md-12">
    <div class="panel panel-default">
    <img src="images/rj.png" class="img-responsive" alt="Responsive image" style="width: 100px">
    <img src="/images/nh.jpg" class="img-responsive center-block" alt="请仔细核对汇款账号" title="请仔细核对汇款账号" style="width: 400px"/>
<!--    <div id="lunbo">-->
<!--        <ul>-->
<!--            <li><img src="/images/nh.jpg" /></li>-->
<!--        </ul>-->
<!--    </div>-->
    </div>
    </div>
</div>
<!--        <div align="center">-->
<!--            <div><font style="font-size: 20px;">上传支付成功截图</font></div>-->
<!--            <from id="form_money">-->
<!--                <div id="preview"></div>-->
<!--                <input type="file" onchange="preview(this)" data-required='1' name="money_order"/>-->
                <from class="form-horizontal">
                    <div class="row" align="center">
                        <p style="font-size: 18px;">温馨提示：</p>
                        <div style="width: 300px;">
                            <font style="font-size: 15px;"><p>入金时间:工作日早9：00-21：00其他时间入金则在工作日时间内转入</p>
                                <p>转款时，请在银行备注栏填写“实名账号+姓名”</p><p>否则无法进行正常入金</p>
                            </font>
                        </div>
                    </div>
                    <br />
                <div class="form-group" >
                    <label class="col-md-4 control-label">充值金额：</label>
                    <div class="col-md-8">
                    <div class="input-group" align="center">
                    <span class="input-group-addon"><span class="fa fa-cny"></span></span>
                    <input type="text" name="moneys" class="form-control" id="exampleInputMoney" placeholder="请输入充值的金额" style="width: 300px;" onpropertychange="cop()" oninput="cop()">
                    </div>
                    <input type="hidden" value="<?=$RMB?>" id="rmb"/>
                   <input id="input4" type="text" style="border-style:solid; border-width:0; text-align: right; font-size: 18px; width:50%; color:#CDC5BF; display:none;" />
                    </div>
                </div>
<!--                <div class="panel-footer">-->
                    <button type='button' class="btn btn-info pull-right btn-block" onclick="rechargeObj.moneyAuth()">
                        提 交
                    </button>
<!--                </div>-->
            </from>
<!--        </div>-->
<br />

<div class="col-md-12">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">入金记录</h3>
            <ul class="panel-controls">
                <li>
                    <a href="javascript:void(0)" class="panel-fullscreen"
                       onclick="panel_fullscreen($(this).parents(' .panel'));">
                        <span class="fa fa-expand"></span>
                    </a>
                </li>
                <li>
                    <a href="javascript:void(0)" class="panel-refresh" onclick="rechargeObj.history(3,0)">
                        <span class="fa fa-refresh"></span>
                    </a>
                </li>
            </ul>
        </div>
        <div class="panel-body">
            <form class="form-inline" role="form" id="form_moneyRechargeHistory">
                <div class="form-group">
                    <label class="sr-only">开始时间</label>
                    <input name='from'
                           type="text"
                           class="form-control datepicker"
                           placeholder="开始时间"
                           value="<?= date('Y-m-d', $from) ?>">
                </div>
                <div class="form-group">
                    <label class="sr-only">结束时间</label>
                    <input name="to"
                           type="text"
                           class="form-control datepicker"
                           placeholder="结束时间"
                           value="<?= date('Y-m-d', $to) ?>">
                </div>
                <div class="form-group">
                    <label class="sr-only">状态</label>
                    <select class="form-control" name="status">
                        <option value="-1">状态 - 全部</option>
                        <option value="1">状态 - 审核中</option>
                        <option value="2">状态 - 成功</option>
                        <option value="3">状态 - 拒绝</option>
                    </select>
                </div>
                <div class="form-group">
                    <button type="button" class="btn btn-block btn-default" onclick="rechargeObj.history(1,1)">
                        查 询
                    </button>
                </div>
            </form>
            <br/>
            <div class="table-responsive">
                <table class="table table-striped table-bordered" id="moneyRechargeHistory_table">
                    <thead>
                    <tr>
                        <th>时间</th>
                        <th class="text-center">订单号</th>
                        <th>状态</th>
                        <th>金额</th>
                    </tr>
                    </thead>
                    <tbody></tbody>
                </table>
            </div>
        </div>
        <div class="panel-footer">
            <form class="form-inline text-center">
                <div class="form-group">
                    <button class="btn-block btn btn-default" type="button" onclick="rechargeObj.history(1,1)">
                        &lt;&lt;
                    </button>
                </div>
                <div class="form-group">
                    <button class="btn-block btn btn-default" type="button" onclick="rechargeObj.history(2,1)">
                        &lt;
                    </button>
                </div>
                <div class="form-group">
                    <div class="input-group">
                            <span class="input-group-addon">
                                共 <span id="moneyRechargeHistory_pageTotal"> </span> 页
                            </span>
                        <input type="number"
                               min="1"
                               class="form-control"
                               id="moneyRechargeHistory_pageNo"
                               placeholder="请输入要跳转的页码"
                               value="1"
                               style="text-align: center;">
                        <span class="input-group-btn">
                                <button type="button"
                                        class="btn btn-default"
                                        onclick="rechargeObj.history(3,0)">
                                    翻 页
                                </button>
                            </span>

                    </div>
                </div>

                <div class="form-group">
                    <button class="btn-block btn btn-default" type="button" onclick="rechargeObj.history(2,2)">
                        &gt;
                    </button>
                </div>
                <div class="form-group">
                    <button class="btn-block btn btn-default" type="button" onclick="rechargeObj.history(1,2)">
                        &gt;&gt;
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
</div>

<script type="text/javascript" src="/js/recharge.js?v=<?= Yii::$app->params['version']; ?>"></script>
<script>
    $('#form_moneyRechargeHistory').find('.datepicker').datepicker({
        autoclose: true,
        format: "yyyy-mm-dd"
    });
        function cop(){
        var str=document.getElementById("exampleInputMoney").value;
        if (str=="") {
            document.getElementById("input4").value="";
            document.getElementById("input4").style.display="none";
        }else{
         document.getElementById("input4").style.display="block";
         var rmb=document.getElementById("rmb").value;
         document.getElementById("input4").value =((str/rmb).toFixed(2))+"美元";
        }
    }
</script>
                <script type="text/javascript">
                    function preview(file) {
                        var prevDiv = document.getElementById('preview');
                        if (file.files && file.files[0]) {
                            var reader = new FileReader();
                            reader.onload = function(evt) {
                                prevDiv.innerHTML = '<img src="' + evt.target.result + '" />';
                            }
                            reader.readAsDataURL(file.files[0]);
                        } else {
                            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
                        }
                    }
 </script>